{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "fd43d8c9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import liepin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b6468812",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('当前数据已导出，数据量为：', 400, '行')"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "liepin.liepin_data(\"广州\",\"产品经理\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "cf8d8bf3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: requests-html in d:\\program files\\anaconda3\\lib\\site-packages (0.10.0)\n",
      "Requirement already satisfied: requests in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (2.31.0)\n",
      "Requirement already satisfied: pyquery in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (2.0.0)\n",
      "Requirement already satisfied: fake-useragent in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (1.1.1)\n",
      "Requirement already satisfied: parse in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (1.19.0)\n",
      "Requirement already satisfied: bs4 in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (0.0.1)\n",
      "Requirement already satisfied: w3lib in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (2.1.1)\n",
      "Requirement already satisfied: pyppeteer>=0.0.14 in d:\\program files\\anaconda3\\lib\\site-packages (from requests-html) (1.0.2)\n",
      "Requirement already satisfied: appdirs<2.0.0,>=1.4.3 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (1.4.4)\n",
      "Requirement already satisfied: certifi>=2021 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (2022.12.7)\n",
      "Requirement already satisfied: importlib-metadata>=1.4 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (6.7.0)\n",
      "Requirement already satisfied: pyee<9.0.0,>=8.1.0 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (8.2.2)\n",
      "Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (4.59.0)\n",
      "Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (1.26.4)\n",
      "Requirement already satisfied: websockets<11.0,>=10.0 in d:\\program files\\anaconda3\\lib\\site-packages (from pyppeteer>=0.0.14->requests-html) (10.4)\n",
      "Requirement already satisfied: beautifulsoup4 in d:\\program files\\anaconda3\\lib\\site-packages (from bs4->requests-html) (4.12.2)\n",
      "Requirement already satisfied: importlib-resources>=5.0 in d:\\program files\\anaconda3\\lib\\site-packages (from fake-useragent->requests-html) (5.12.0)\n",
      "Requirement already satisfied: lxml>=2.1 in d:\\program files\\anaconda3\\lib\\site-packages (from pyquery->requests-html) (4.6.3)\n",
      "Requirement already satisfied: cssselect>=1.2.0 in d:\\program files\\anaconda3\\lib\\site-packages (from pyquery->requests-html) (1.2.0)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in d:\\program files\\anaconda3\\lib\\site-packages (from requests->requests-html) (3.1.0)\n",
      "Requirement already satisfied: idna<4,>=2.5 in d:\\program files\\anaconda3\\lib\\site-packages (from requests->requests-html) (3.4)\n",
      "Requirement already satisfied: zipp>=0.5 in d:\\program files\\anaconda3\\lib\\site-packages (from importlib-metadata>=1.4->pyppeteer>=0.0.14->requests-html) (3.15.0)\n",
      "Requirement already satisfied: soupsieve>1.2 in d:\\program files\\anaconda3\\lib\\site-packages (from beautifulsoup4->bs4->requests-html) (2.4.1)\n"
     ]
    }
   ],
   "source": [
    "!pip install requests-html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2cadda28",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " * Serving Flask app '__main__' (lazy loading)\n",
      " * Environment: production\n",
      "\u001b[31m   WARNING: This is a development server. Do not use it in a production deployment.\u001b[0m\n",
      "\u001b[2m   Use a production WSGI server instead.\u001b[0m\n",
      " * Debug mode: off\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      " * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n",
      "127.0.0.1 - - [24/Jun/2023 22:37:43] \"GET / HTTP/1.1\" 405 -\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "from flask import Flask\n",
    "from jinja2 import Markup, Environment, FileSystemLoader\n",
    "from pyecharts.globals import CurrentConfig\n",
    "\n",
    "# 关于 CurrentConfig，可参考 [基本使用-全局变量]\n",
    "CurrentConfig.GLOBAL_ENV = Environment(loader=FileSystemLoader(\"./templates\"))\n",
    "\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "\n",
    "\n",
    "app = Flask(__name__, static_folder=\"templates\")\n",
    "\n",
    "\n",
    "\n",
    "@app.route(\"/\",methods=['POST'])\n",
    "def index():\n",
    "    if request.method == 'POST':\n",
    "        # 处理 POST 请求\n",
    "        return 'Received a POST request!'\n",
    "    else:\n",
    "        # 处理 GET 请求\n",
    "        return 'Received a GET request!'\n",
    "    地区 = request.form['dq']\n",
    "    职位 = request.form['job']\n",
    "    liepin.liepin_data(地区,职位)\n",
    "    c = liepin.liepin_dq(\"广州\")\n",
    "    return Markup(c.render_embed())\n",
    "\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    app.run()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "124b0a67",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5a2440f5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40aa6d03",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
